package com.example.idachuappone.index.entity;

import com.example.idachuappone.index.welcomentity.WelcomeUri;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class FamilyFeast implements Serializable {
    private String description;
    private List<String> flow;
    private String head;
    private String id;
    private List<FamilyFeastImgs> imgs;
    private boolean isUrl;
    private String name;
    private String price;
    private List<FamilyFeastRecipes> recipes;
    private String slogan;
    private WelcomeUri uri;
    private String url;

    public FamilyFeast parseJson(JSONObject json) {
        if (json == null) {
            return null;
        }
        JSONArray jsonArray;
        int i;
        if (json.has("id")) {
            this.id = json.optString("id");
        }
        if (json.has("name")) {
            this.name = json.optString("name");
        }
        if (json.has("slogan")) {
            this.slogan = json.optString("slogan");
        }
        if (json.has("head")) {
            this.head = json.optString("head");
        }
        if (json.has("description")) {
            this.description = json.optString("description");
        }
        if (json.has("price")) {
            this.price = json.optString("price");
        }
        if (json.has("uri")) {
            try {
                this.isUrl = false;
                WelcomeUri welcomeUri = new WelcomeUri();
                welcomeUri.parseJson(json.getJSONObject("uri"));
                this.uri = welcomeUri;
            } catch (Exception e) {
                this.isUrl = true;
                this.url = json.optString("uri");
            }
        }
        if (json.has("imgs")) {
            this.imgs = new ArrayList();
            try {
                jsonArray = json.getJSONArray("imgs");
                for (i = 0; i < jsonArray.length(); i++) {
                    this.imgs.add(new FamilyFeastImgs().parseJson(jsonArray.getJSONObject(i)));
                }
            } catch (JSONException e2) {
                e2.printStackTrace();
            }
        }
        if (json.has("recipes")) {
            this.recipes = new ArrayList();
            try {
                jsonArray = json.getJSONArray("recipes");
                for (i = 0; i < jsonArray.length(); i++) {
                    this.recipes.add(new FamilyFeastRecipes().parseJson(jsonArray.getJSONObject(i)));
                }
            } catch (JSONException e22) {
                e22.printStackTrace();
            }
        }
        if (!json.has("flow")) {
            return this;
        }
        this.flow = new ArrayList();
        try {
            jsonArray = json.getJSONArray("flow");
            for (i = 0; i < jsonArray.length(); i++) {
                this.flow.add(jsonArray.getString(i));
            }
            return this;
        } catch (JSONException e222) {
            e222.printStackTrace();
            return this;
        }
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSlogan() {
        return this.slogan;
    }

    public void setSlogan(String slogan) {
        this.slogan = slogan;
    }

    public String getHead() {
        return this.head;
    }

    public void setHead(String head) {
        this.head = head;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getPrice() {
        return this.price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public List<FamilyFeastImgs> getImgs() {
        return this.imgs;
    }

    public void setImgs(List<FamilyFeastImgs> imgs) {
        this.imgs = imgs;
    }

    public List<FamilyFeastRecipes> getRecipes() {
        return this.recipes;
    }

    public void setRecipes(List<FamilyFeastRecipes> recipes) {
        this.recipes = recipes;
    }

    public List<String> getFlow() {
        return this.flow;
    }

    public void setFlow(List<String> flow) {
        this.flow = flow;
    }

    public WelcomeUri getUri() {
        return this.uri;
    }

    public void setUri(WelcomeUri uri) {
        this.uri = uri;
    }

    public boolean isUrl() {
        return this.isUrl;
    }

    public void setUrl(boolean isUrl) {
        this.isUrl = isUrl;
    }

    public String getUrl() {
        return this.url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
}
